<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        const p1 = new Promise(function (resolve, reject) {
            // ... some code

            if (1 == "1") {
                resolve(33);
            } else {
                reject(44);
            }
        });
        const p2 = new Promise(function (resolve, reject) {
            // ... some code

            if (1 == "1") {
                resolve(33);
            } else {
                reject(44);
            }
        });
        // p1.then((res) => {
        //     console.log(res);
        // }, (err) => {
        //     console.log(err);
        // })
        const p = Promise.all([p1, p2]);
        p.then((res)=>{
            console.log(res);
        },(err)=>{
            console.log(err);
        })


        var a=4
        function fn(){
            console.log(a);
            var a=5
        }
        fn()


        var arr=[1,3,2,5,6,56,7,100,54]
        console.log(arr.sort(function(a,b){
            return a-b
        }));


        function c(){

        }
        
        var  c=1
        console.log(c);
    </script>
</body>

</html>